import QtQuick 1.0
import com.meego 1.0


Page {
    id: searchedInfo

    tools: ToolBarLayout {

        ToolButton {
            visible: false
        }
        ToolButton {
            id: toolClear
            visible: true
            text: "Pulisci"
            onClicked: {
                clickSound.play()
                pageStack.pop()
            }
        }
    }

    function populateInfo(arrayInfo) {
        for (var i = 0; i < arrayInfo.length; i++)
            if (i === 0) txtTelaio.text = arrayInfo[i];
            else if (i === 1) txtModello.text = arrayInfo[i];
            else if (i === 2) txtFabbricazione.text = arrayInfo[i];
            else if (i === 3) txtTipo.text = arrayInfo[i];
            else if (i === 4) {
                txtNote.text = arrayInfo[i].replace("#000080", "#006aff");
                txtNote.text = txtNote.text.replace("#000080", "#006aff");
                txtNote.text = txtNote.text.replace("#000080", "#006aff");
                txtNote.text = txtNote.text.replace("#000080", "#006aff");
            }
    }

    Text {
        id: text1
        y: searchedInfo.y + 15
        color: "#be0808"
        text: "Dati Recuperati online"
        font.bold: true
        horizontalAlignment: Text.AlignHCenter
        anchors.left: parent.left
        anchors.leftMargin: 5
        anchors.right: parent.right
        anchors.rightMargin: 5
        font.pixelSize: 28
    }

    Image {
        id: image1
        x: (searchedInfo.width - image1.width) / 2
        y: text1.height + text1.y + 10
        width: 32
        height: 32
        source: "qrc:/write.png"
    }

    Text {
        id: labelTelaio
        x: 15
        y: 143
        color: "#be0808"
        text: "Numero di telaio recuperato:"
        font.pixelSize: 20
        font.bold: true
    }

    Text {
        id: txtTelaio
        x: 15
        y: labelTelaio.y + labelTelaio.height + 5
        width: 300
        color: "#006aff"
        text: ""
        font.italic: true
        font.underline: false
        smooth: true
        font.pixelSize: 18
    }

    Text {
        id: labelModello
        x: 15
        y: txtTelaio.y + txtTelaio.height + 15
        color: "#be0808"
        text: "Modello veicolo recuperato:"
        font.pixelSize: 20
        font.bold: true
    }

    Text {
        id: txtModello
        x: 15
        y: labelModello.y + labelModello.height + 5
        width: 300
        color: "#006aff"
        text: ""
        font.italic: true
        font.underline: false
        smooth: true
        font.pixelSize: 18
    }

    Text {
        id: labelFabbricazione
        x: 15
        y: txtModello.y + txtModello.height + 15
        color: "#be0808"
        text: "Veicolo di fabbricazione:"
        font.pixelSize: 20
        font.bold: true
    }

    Text {
        id: txtFabbricazione
        x: 15
        y: labelFabbricazione.y + labelFabbricazione.height + 5
        width: 300
         color: "#006aff"
        text: ""
        font.italic: true
        font.underline: false
        smooth: true
        font.pixelSize: 18
    }

    Text {
        id: labelTipo
        x: 15
        y: txtFabbricazione.y + txtFabbricazione.height + 15
        color: "#be0808"
        text: "Tipo di veicolo recuperato:"
        font.pixelSize: 20;
        font.bold: true
    }

    Text {
        id: txtTipo
        x: 15
        y: labelTipo.y + labelTipo.height + 5
        width: 300
        color: "#006aff"
        text: ""
        font.italic: true
        font.underline: false
        smooth: true
        font.pixelSize: 18
    }

    Text {
        id: labelNote
        x: 15
        y: txtTipo.y + txtTipo.height + 15
        color: "#be0808"
        text: "Note varie recuperate:"
        font.pixelSize: 20
        font.bold: true
    }

    Text {
        id: txtNote
        y: labelNote.y + labelNote.height + 5
        height: 106
        color: "#f9f8f8"
        text: "Prov"
        anchors.left: parent.left
        anchors.leftMargin: 15
        clip: false
        z: 0
        verticalAlignment: Text.AlignTop
        anchors.right: parent.right
        anchors.rightMargin: 15
        horizontalAlignment: Text.AlignLeft
        wrapMode: Text.WordWrap
        font.italic: true
        font.underline: false
        styleColor: "#f9f4f4"
        smooth: false
        font.pixelSize: 23
    }
}
